/*
 * MySnsGatewayManager.h
 *
 *  Created on: May 16, 2011
 *      Author: MongKieu
 */

#ifndef MYSNSGATEWAYMANAGER_H_
#define MYSNSGATEWAYMANAGER_H_
#include"FBase.h"
#include"FSocial.h"

#include"FApp.h"
class MySnsGatewayManager: public Osp::Social::Services::ISnsGatewayListener,
		public Osp::Social::Services::ISnsPeopleListener,
		public Osp::Social::Services::ISnsActivityListener {
public:
	MySnsGatewayManager();
	virtual ~MySnsGatewayManager();
	bool Initialize();
public:
	void AddTwitterAuthResult(
			const Osp::Social::Services::SnsAuthResult& authResult);
	void RemoveTwitterAuthResult(void);
	void RequestActivities(void);
	bool RequestMoreActivities(void);
	bool RequestHomeActivies();
	bool RequesrMoreFriends();
	bool RequestHomeFriends();
	bool CheckLoginStatus(void);
	void RequestMyProfile();
	void RequestMyUserNameFromProfile();
	void RequestFollowingList();
	void UpdateMyStatusText(Osp::Base::String myStatus);
	void RequestProfileFollowingByIndex(int index);
	void RequestPhotoByUser();
public:
	// Listener
	// Gateway Listener
	// Gateway Listener
	virtual void OnSnsLoggedInStatusReceived(RequestId reqId,
			Osp::Base::String& serviceProvider, bool isLoggedIn, result r,
			const Osp::Base::String& errorCode,
			const Osp::Base::String& errorMsg);

	// People Listener
	virtual void OnMySnsBuddiesReceivedN(RequestId reqId,
			Osp::Base::Collection::IList *pBuddyProfileList, bool hasNext,
			Osp::Social::Services::SnsPagingParam& pagingParam, result r,
			const Osp::Base::String &errorCode,
			const Osp::Base::String &errorMsg);
	virtual void OnMySnsStatusTextUpdated(RequestId reqId,
			Osp::Base::String &serviceProvider, result r,
			const Osp::Base::String &errorCode,
			const Osp::Base::String &errorMsg);
	virtual void OnSnsStatusTextReceived(RequestId reqId,
			Osp::Social::Services::SnsStatusText* pStatusText, result r,
			const Osp::Base::String& errorCode,
			const Osp::Base::String& errorMsg);
	virtual void OnSnsProfileReceived(RequestId reqId,
			Osp::Social::Services::SnsProfile *pProfile, result r,
			const Osp::Base::String &errorCode,
			const Osp::Base::String &errorMsg);

	// Activity Listener
	virtual void OnSnsActivitiesReceivedN(RequestId reqId,
			Osp::Base::Collection::IList* pActivityList, bool hasNext,
			Osp::Social::Services::SnsPagingParam& pagingParam, result r,
			const Osp::Base::String& errorCode,
			const Osp::Base::String& errorMsg);
	Osp::Social::Services::SnsProfile* GetSnsProfileByIndex(int index);

private:

	Osp::Social::Services::SnsGateway* __pSnsGateway;
	Osp::Base::Collection::IList* __pBuddyMemberList;
	bool __isMyProfile;
	bool __isGetMyUserNameProfile;
	Osp::Social::Services::SnsPagingParam* __pPagingParam;
	Osp::Social::Services::SnsPagingParam* __pPagingParamBuddies;

};

#endif /* MYSNSGATEWAYMANAGER_H_ */
